USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0002_IMPUESTO]    Script Date: 11/24/2011 14:33:01 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WASP_M0002_IMPUESTO]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[WASP_M0002_IMPUESTO]
GO

USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0002_IMPUESTO]    Script Date: 11/24/2011 14:33:01 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[WASP_M0002_IMPUESTO] 
AS
BEGIN
	SELECT	ppsuc       AS suc
			,ppcta       AS cta
			,ppoper      AS ope
			,SUM(ppicap) AS impuesto
	INTO	dbo.impuesto
	FROM	fsd601 (NOLOCK)
	WHERE	d601co = 'S'
	GROUP BY ppsuc
			,ppcta
			,ppoper
END

GO


